Skip to content

SG-44731 Adopt Git LFS for tk-core vendored dependency ZIPs and Qt resources - #1128

Draft
julien-lang wants to merge 8 commits into
masterfrom
ticket/SG-42549-git-lfs
Draft

SG-44731 Adopt Git LFS for tk-core vendored dependency ZIPs and Qt resources#1128
julien-lang wants to merge 8 commits into
masterfrom
ticket/SG-42549-git-lfs

Conversation

@julien-lang

@julien-lang julien-lang commented Aug 10, 2026

Copy link
Copy Markdown
Member

Problem

Adopts Git LFS for large vendored/binary files in tk-core to reduce repo/clone size.

Changes

  • requirements/**/*.zip (pkgs.zip for all supported Python versions, flow_data_sdk-beta.zip) are now tracked via Git LFS (filter=lfs diff=lfs merge=lfs -text in .gitattributes).
  • python/tank/**/resources_rc.py (compiled Qt resources, previously large embedded-binary Python source files) and *.ttf (Qt UI fonts) are now tracked via Git LFS as well.
  • .tkdeploy: refreshed the packaging exclusion list, replacing obsolete CI file names (.travis.yml, appveyor.yml) with the ones actually used today (.pre-commit-config.yaml, azure-pipelines.yml, build_resources.yml, codecov.yml, developer/).
  • azure-pipelines.yml: restricted the branch trigger to master (was *).
  • python/tank/descriptor/io_descriptor/git.py: added _validate_lfs_content() on the shared IODescriptorGit base class, called after every clone in _clone_then_execute_git_commands() (covers both the branch and tag descriptors, for persistent downloads and transient temp-clones alike). If the checked out repo declares filter=lfs in .gitattributes, this verifies via git lfs ls-files --json that tracked files were actually resolved to real content, and raises a clear error if git-lfs isn't installed or some content is still a bare pointer, instead of silently proceeding with broken files.
  • docs/descriptor.rst: documented the new Git LFS requirements for the git/git_branch descriptors (need git-lfs installed, or Toolkit raises an error) and for the github_release descriptor (repo's "Include Git LFS objects in archives" GitHub setting must be enabled, since release archives otherwise contain unresolved LFS pointer files).

Note before merging

azure-pipelines.yml currently pins the tk-ci-tools template ref to refs/heads/ticket/SG-44731-use-git-lfs (marked TEMP in the file) so this branch can be end-to-end tested against tk-ci-tools#77 before that PR merges.
This must be reverted to master once tk-ci-tools#77 is merged, or CI on this branch will keep depending on an unmerged branch.

Testing

  • Pushed and observed CI results (pending confirmation).
  • _validate_lfs_content() verified locally against 4 scenarios: LFS content properly downloaded, non-LFS repo, missing git-lfs binary, and a real unsmudged clone (GIT_LFS_SKIP_SMUDGE=1) - all detected correctly.

- .tkdeploy: replace obsolete CI file exclusions (.travis.yml,
  appveyor.yml) with the files actually used today
  (.pre-commit-config.yaml, azure-pipelines.yml, build_resources.yml,
  codecov.yml, developer/)
- azure-pipelines.yml: restrict branch trigger to master (was "*"), and
  temporarily pin the tk-ci-tools template ref to
  ticket/SG-44731-use-git-lfs for end-to-end testing before that PR
  merges
- .gitattributes: minor formatting (blank lines, comment header for the
  LFS rule)
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.63158% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.08%. Comparing base (889c1cd) to head (7367e16).

Files with missing lines Patch % Lines
python/tank/descriptor/io_descriptor/git.py 52.63% 9 Missing ⚠️

❌ Your patch check has failed because the patch coverage (52.63%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1128      +/-   ##
==========================================
- Coverage   80.09%   80.08%   -0.02%     
==========================================
  Files         203      203              
  Lines       19537    19556      +19     
==========================================
+ Hits        15649    15661      +12     
- Misses       3888     3895       +7     
Flag Coverage Δ
Linux 79.51% <52.63%> (-0.03%) ⬇️
Python-3.10 79.89% <52.63%> (-0.02%) ⬇️
Python-3.11 79.79% <52.63%> (-0.02%) ⬇️
Python-3.13 79.78% <52.63%> (-0.03%) ⬇️
Python-3.9 79.85% <52.63%> (-0.03%) ⬇️
Windows 79.55% <52.63%> (-0.02%) ⬇️
macOS 79.48% <52.63%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.


qInitResources()
version https://git-lfs.github.com/spec/v1
oid sha256:8376f448174f66831ffd5b1ee0a8c2a9275a3d98dfad3e4a24289069d2ddc107

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ':'



qInitResources()
version https://git-lfs.github.com/spec/v1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ':'
missing whitespace around arithmetic operator

Adds _validate_lfs_content(), called at the end of
_clone_then_execute_git_commands(), the shared clone path used by both
the git branch and git tag descriptors (persistent downloads and
transient temp-clones alike).

If the checked out repo's root .gitattributes declares filter=lfs,
verifies via 'git lfs ls-files --json' that tracked files were
actually smudged to their real content. Raises TankGitError if:
- the git-lfs binary isn't installed/on PATH, or
- any tracked file is still a bare LFS pointer (not checked out).

Repos that don't declare LFS tracking skip the check entirely, so
there's no new dependency on git-lfs for the vast majority of
existing git descriptors.
@julien-lang julien-lang changed the title SG-44731 Adopt Git LFS for tk-core vendored dependency ZIPs SG-44731 Adopt Git LFS for tk-core vendored dependency ZIPs and Qt resources Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant